package com.linkgie.galaxyframework.utils.image.qr;

import java.io.ByteArrayOutputStream;
import java.io.File;

import com.linkgie.galaxyframework.utils.io.FileUtils;

public class QRCodeTest {

	public static void main(String[] args) {

		try {
			// BufferedImage img = QRCodeUtil.createImage("https://www.linkgie.com");

			ByteArrayOutputStream out = new ByteArrayOutputStream();
			QRCodeUtils.generateImage("token:9783209dhn3", "jpg", out);
			System.out.println("----------");
			// ImageIO.write(img, "png", out);
			File file = new File("./testcode.jpg");
			FileUtils.writeBytes(out.toByteArray(), file);
			System.out.println("输出二维码：" + file.getAbsolutePath());
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}
